﻿define(
    ['jquery', 'ko', 'config', 'viewmodels/vm'],
    function ($, ko, config, vm) {
        var
            ids = config.viewIds,

            bind = function () {
                ko.applyBindings(vm.vmMainMenu, getView(ids.mainMenu));
                ko.applyBindings(vm.vmLogo, getView(ids.logo));
                ko.applyBindings(vm.vmPageTitle, getView(ids.pageTitle));
                ko.applyBindings(vm.vmPagePath, getView(ids.pagePath));
                ko.applyBindings(vm.vmBottomLinks, getView(ids.bottomLinks));
                ko.applyBindings(vm.vmTopLinks, getView(ids.topLinks));
                ko.applyBindings(vm.vmContactInfo, getView(ids.contactInfo));
                ko.applyBindings(vm.vmLanguageChooser, getView(ids.languageChooser));
            },
            
            getView = function (viewName) {
                return $(viewName).get(0);
            };
            
        return {
            bind: bind
        };
    });